<?php
class Model_ProductWords {
	function Model_ProductWords() {
		  $this->_tbProductWords =& FLEA::getSingleton('Model_DB_ProductWords');
	}
	function getProductWord($pwid,$withAssoc=true) {
		$link =& $this->_tbProductWords->getLink('product');
		$link->enabled = $withAssoc;
		$link =& $this->_tbProductWords->getLink('user');
		$link->enabled = $withAssoc;
		return $this->_tbProductWords->find((int)$pwid);
	}
	function getProductWords($pid,$withAssoc=false) {
		$link = & $this->_tbProductWords->getLink("product");
		$link->enabled = $withAssoc;
		return $this->_tbProductWords->findAllByField("pid",$pid);
	}
    function & getTable() {
        return $this->_tbProductWords;
    }
}
?>